    import java.util.Scanner;

    public class demo1 {
        public static int findNum(int i) {
            int sum=0;
            for(int n=1;n*n<i;n++) {
                if(i%n==0) {
                    sum+=n;
                    if(i/n!=n && i/n!=i) {
                        sum+=(i/n);
                    }
                }
            }
            return sum;
        }
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int count=0;
            int n=scanner.nextInt();
            for(int i=2;i<n;i++) {
                if(findNum(i)==i) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
